<?php defined('ByShopWWI') or exit('Access Invalid!');?>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <div class="subject">
        <h3>报单中心申请管理</h3>
        <h5>会员等级为店长的用户向后台申请成为报单中心</h5>
      </div>
    </div>
  </div>
  <!-- 操作说明 -->
  <div class="explanation" id="explanation">
    <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
      <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
      <span id="explanationZoom" title=""></span> </div>
    <ul>
      <li>后台管理员可以通过审批店长提交过来的申请，授权店长为报单中心</li>
      <li>审批通过后，该店长即成为报单中心</li>
    </ul>
  </div>
  <div id="flexigrid"></div>
</div>
<script type="text/javascript">
$(function(){
    $("#flexigrid").flexigrid({
        url: 'index.php?act=apply_form&op=get_xml',
        colModel : [
            {display: '操作', name : 'operation', width : 200, sortable : false, align: 'center'},
            {display: '申请ID', name : 'apply_form_id', width : 100, sortable : true, align: 'center'},
            {display: '会员名称', name : 'member_name', width : 120, sortable : true, align: 'left'},
            {display: '真实姓名', name : 'member_truename', width : 120, sortable : true, align: 'left'},
            {display: '申请备注', name : 'remark', width : 360, sortable : true, align: 'left'},
            {display: '申请时间', name : 'apply_time', width : 150, sortable : true, align: 'center'},
            {display: '审批状态', name : 'status', width : 100, sortable : true, align: 'center', className: 'abnormal'},
           
            ],
        buttons : [
            {display: '<i class="fa fa-file-excel-o"></i>导出数据', name : 'csv', bclass : 'csv', title : '将选定行数据导出CVS文件', onpress : fg_operation }		
            ],
        searchitems : [
            {display: '会员ID', name : 'member_id'},
            {display: '会员名称', name : 'member_name'},
            {display: '真实姓名', name : 'member_truename'},
            

            ],
        sortname: "apply_time",
        sortorder: "desc",
        title: '申请列表'
    });
	
});

function fg_operation(name, bDiv) {
   
    if (name == 'csv') {
        if ($('.trSelected', bDiv).length == 0) {
            if (!confirm('您确定要下载全部数据吗？')) {
                return false;
            }
        }
        var itemids = new Array();
        $('.trSelected', bDiv).each(function(i){
            itemids[i] = $(this).attr('data-id');
        });
        fg_csv(itemids);
    }
}

function fg_csv(ids) {
    id = ids.join(',');
    window.location.href = $("#flexigrid").flexSimpleSearchQueryString()+'&op=export_csv&id=' + id;
}
</script> 

